﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Paint;
using System.Drawing;

namespace TextPluginNamespace
{
    [Serializable]
    public class Text : Drawable
    {
        public int fontFamilyIndex { get; set; }
        public int fontSize {get; set; }
        public String text { get; set; }


        public Text(Point startPoint, Point endPoint) : base(startPoint, endPoint) { }
        
        public override void draw(Graphics g)
        {
            g.DrawString(text, createFont(), new SolidBrush(context.penColor), new PointF(startPoint.X, startPoint.Y));
        }

        private Font createFont()
        {
            return new Font(FontFamily.Families[fontFamilyIndex], fontSize);
        }
    }
}
